package hy.planegame.sprite

import android.graphics.Canvas

/**
 * Created time : 2017/8/31 15:17.
 * @author HY
 */
abstract class Sprite<T : Sprite<T>> {

    abstract fun draw(canvas: Canvas?)

    abstract fun logic()

    abstract fun destroy()

    protected var _onStop: ((t:T) -> Unit)? = null

    fun stop(callback: (t:T) -> Unit) {
        _onStop = callback
    }
}